package com.sharer.last.model.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sharer.last.base.model.BasePO;
import lombok.*;

import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 博客标签
 *
 * @ClassName TagPO
 * @Author WangJin
 * @Date 2023/5/5 17:36
 * @Description
 * @Version 1.0
 */
@TableName("tag")
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
@EqualsAndHashCode(callSuper = true)
public class TagPO extends BasePO {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 标签名称
     */
    private String tagName;

    /**
     * 标签颜色(与Semantic UI提供的颜色对应，可选)
     */
    private String color;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TagPO tagPO = (TagPO) o;
        return id.equals(tagPO.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
